package com.hsqn.service.impl;

import com.hsqn.entity.HealthAndSafety;
import com.hsqn.mapper.HealthAndSafetyMapper;
import com.hsqn.service.HealthAndSafetyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Service
public class HealthAndSafetyServicerImpl implements HealthAndSafetyService {
    @Autowired
    HealthAndSafetyMapper healthAndSafetyMapper;

    @Override
    public HealthAndSafety Insertelderly(HealthAndSafety user) {
        LocalDateTime now = LocalDateTime.now();
        // 确保属性名正确
        user.setBirthDate(LocalDate.now());
        user.setCreatedTime(now);
        user.setUpdatedTime(now);
        healthAndSafetyMapper.Insertelderly(user);
        return user;
    }

    @Override
    public HealthAndSafety InserteHealthRecord(HealthAndSafety healthAndSafety) {
        return null;
    }
}
